{extend name="layout"}
{block name="content"}
<div class="col-sm-8">
    <blockquote>
        <p>{$topic_info.title}</p>
        <footer>文章：{$topic_posts_count}</footer>
        {if !$posts}
        <button class="btn btn-default topic-submit" data-toggle="modal" data-target="#topic_submit_modal" topic-id="{$topic_info.id}" type="button">投稿
        {/if}
        </button>
    </blockquote>
</div>
<div class="modal fade" id="topic_submit_modal" tabindex="-1" role="dialog">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">我的文章</h4>
            </div>
            <div class="modal-body">
                <form action="/topic/{$topic_info.id}/submit" method="post">
                    <!--尚未投稿的-->
                    {volist name='posts' id='post'}
                    <input type="hidden" name="__token__" value="{$Request.token}">
                    <div class="checkbox">
                        <label>
                            <input type="checkbox" name="post_ids[]" value="{$post.id}">
                            {$post.title}
                        </label>
                    </div>
                    {/volist}
                    <button type="submit" class="btn btn-default">投稿</button>
                </form>
            </div>
        </div>
    </div>
</div>

<!--  专题下所有文章  -->
<div class="col-sm-8 blog-main">
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">文章</a></li>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="tab_1">
            {volist name='topic_posts' id='topic_post'}
                <div class="blog-post" style="margin-top: 30px">
                    <p class=""><a href="/user/{$topic_post->uid}">{$topic_post->user->nickname}</a> {$topic_post.create_time|date='Y-m-d'}</p>
                    <p class=""><a href="/posts/{$topic_post->id}/show">{$topic_post->title}</a></p>

                    <p>{:str_limit(strip_tags($topic_post->content),20)}</p>
                </div>
            {/volist}

            {$topic_posts|raw}
            </div>

        </div>
        <!-- /.tab-content -->
    </div>


</div><!-- /.blog-main -->
{/block}